home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / bit / src / ulib / replace.c < prev    next >
C/C++ Source or Header  |  1994-08-01  |  899b  |  36 lines

  1. /***********************************************************************
  2.  * $Id: replace.c,v 0.80 1994/02/24 09:48:11 zhao Exp $
  3.  *
  4.  *.  Copyright(c) 1993,1994 by T.C. Zhao
  5.  *   All rights reserved.
  6.  *.
  7.  *   simulation of some handy function if not available otherwise
  8.  *   on the system: strdup, strcasecmp etc.
  9.  ***********************************************************************/
  10. #if !defined(lint) && defined(F_ID)
  11. char *id_sfake = "$Id: replace.c,v 0.80 1994/02/24 09:48:11 zhao Exp $";
  12. #endif
  13.  
  14. #include <string.h>
  15. #include <stdlib.h>
  16. #include <ctype.h>
  17. #include "ulib.h"
  18.  
  19. #if (defined(NO_STRDUP) || defined(__STRICT_ANSI__)) && !defined(__sgi__)
  20.  
  21. char *
  22. strdup(const char *s)
  23. {
  24.     char *p = malloc(strlen(s) + 1);
  25.     return p ? strcpy(p, s) : 0;
  26. }
  27.  
  28. int
  29. strcasecmp(const char *s1, const char *s2)
  30. {
  31.     fputs("strcasecmp: not written yet\n", stderr);
  32.     return strcmp(s1, s2);
  33. }
  34.  
  35. #endif
  36.